class PodtvType
  attr_accessor :id, :name, :notes

  def initialize(options = {})
    options = options.symbolize_keys
    @id, @name, @notes = options[:id], options[:name], options[:notes]
  end

  def symbol
    @name.to_s.downcase.intern
  end

  def self.[](value)
    @@data.find { |data| data.symbol == value.to_s.downcase.intern }
  end

  def self.find(id)
    @@data.find { |data| data.id.to_s == id.to_s }
  end

  def self.find_all
    @@data.dup
  end

  @@data = [
    PodtvType.new(:id => 1, :name => '2-НДФЛ', :notes => ''),
    PodtvType.new(:id => 2, :name => '2-НДФЛ + форма банка', :notes => ''),
    PodtvType.new(:id => 3, :name => '2-НДФЛ + свободная форма', :notes => ''),
    PodtvType.new(:id => 4, :name => 'Форма банка', :notes => ''),
    PodtvType.new(:id => 5, :name => 'Форма банка + свободная', :notes => ''),
    PodtvType.new(:id => 6, :name => 'Свободная форма', :notes => ''),
    PodtvType.new(:id => 7, :name => 'Не могу подтвердить', :notes => '')
  ]
end
